Skip to content

Conversation

@18202781743
Copy link
Contributor

Fixed multiple compiler warnings across the codebase including:

  1. Removed unused variable 'byte_count' in DBackingStoreProxy
  2. Added [[maybe_unused]] attribute to unused functions
    getInputRectangleY and atomName
  3. Removed Q_DECL_HIDDEN from several class declarations
  4. Fixed initialization order in DXcbXSettingsPrivate constructor
  5. Removed negative check for function pointer offset in VtableHook
  6. Added override keyword to test class methods
  7. Added Q_UNUSED for unused parameters in various functions
  8. Fixed potential integer comparison issues in DWaylandInterfaceHook
  9. Added proper type casting for window property comparison
  10. Fixed Qt version conditional compilation in
    DPlatformBackingStoreHelper

These changes improve code quality by:

  • Removing dead code
  • Making unused function intentions explicit
  • Following modern C++ practices
  • Ensuring proper initialization order
  • Preventing potential integer comparison issues
  • Maintaining cross-version Qt compatibility

Influence:

  1. Verify wallpaper sharing functionality still works
  2. Test input handling in text fields
  3. Validate platform settings behavior
  4. Check XSettings integration
  5. Test vtable hooking functionality
  6. Verify unit tests still pass
  7. Test wayland window splitting functionality
  8. Validate high DPI scaling behavior

fix: 修复各种编译器警告

修复了代码库中的多个编译器警告,包括:

  1. 移除DBackingStoreProxy中未使用的变量'byte_count'
  2. 为未使用的函数getInputRectangleY和atomName添加[[maybe_unused]]属性
  3. 从多个类声明中移除Q_DECL_HIDDEN
  4. 修复DXcbXSettingsPrivate构造函数中的初始化顺序
  5. 移除VtableHook中对函数指针偏移量的负值检查
  6. 为测试类方法添加override关键字
  7. 为多个未使用的参数添加Q_UNUSED
  8. 修复DWaylandInterfaceHook中潜在的整数比较问题
  9. 为窗口属性比较添加适当的类型转换
  10. 修复DPlatformBackingStoreHelper中的Qt版本条件编译

这些改进通过以下方式提升代码质量:

  • 移除无用代码
  • 明确未使用函数的意图
  • 遵循现代C++实践
  • 确保正确的初始化顺序
  • 防止潜在的整数比较问题
  • 保持跨Qt版本的兼容性

Influence:

  1. 验证壁纸共享功能是否仍然正常工作
  2. 测试文本字段中的输入处理
  3. 验证平台设置行为
  4. 检查XSettings集成
  5. 测试vtable钩子功能
  6. 验证单元测试是否仍然通过
  7. 测试wayland窗口分割功能
  8. 验证高DPI缩放行为

Fixed multiple compiler warnings across the codebase including:
1. Removed unused variable 'byte_count' in DBackingStoreProxy
2. Added [[maybe_unused]] attribute to unused functions
getInputRectangleY and atomName
3. Removed Q_DECL_HIDDEN from several class declarations
4. Fixed initialization order in DXcbXSettingsPrivate constructor
5. Removed negative check for function pointer offset in VtableHook
6. Added override keyword to test class methods
7. Added Q_UNUSED for unused parameters in various functions
8. Fixed potential integer comparison issues in DWaylandInterfaceHook
9. Added proper type casting for window property comparison
10. Fixed Qt version conditional compilation in
DPlatformBackingStoreHelper

These changes improve code quality by:
- Removing dead code
- Making unused function intentions explicit
- Following modern C++ practices
- Ensuring proper initialization order
- Preventing potential integer comparison issues
- Maintaining cross-version Qt compatibility

Influence:
1. Verify wallpaper sharing functionality still works
2. Test input handling in text fields
3. Validate platform settings behavior
4. Check XSettings integration
5. Test vtable hooking functionality
6. Verify unit tests still pass
7. Test wayland window splitting functionality
8. Validate high DPI scaling behavior

fix: 修复各种编译器警告

修复了代码库中的多个编译器警告,包括:
1. 移除DBackingStoreProxy中未使用的变量'byte_count'
2. 为未使用的函数getInputRectangleY和atomName添加[[maybe_unused]]属性
3. 从多个类声明中移除Q_DECL_HIDDEN
4. 修复DXcbXSettingsPrivate构造函数中的初始化顺序
5. 移除VtableHook中对函数指针偏移量的负值检查
6. 为测试类方法添加override关键字
7. 为多个未使用的参数添加Q_UNUSED
8. 修复DWaylandInterfaceHook中潜在的整数比较问题
9. 为窗口属性比较添加适当的类型转换
10. 修复DPlatformBackingStoreHelper中的Qt版本条件编译

这些改进通过以下方式提升代码质量:
- 移除无用代码
- 明确未使用函数的意图
- 遵循现代C++实践
- 确保正确的初始化顺序
- 防止潜在的整数比较问题
- 保持跨Qt版本的兼容性

Influence:
1. 验证壁纸共享功能是否仍然正常工作
2. 测试文本字段中的输入处理
3. 验证平台设置行为
4. 检查XSettings集成
5. 测试vtable钩子功能
6. 验证单元测试是否仍然通过
7. 测试wayland窗口分割功能
8. 验证高DPI缩放行为
@18202781743 18202781743 requested review from BLumia and mhduiy August 18, 2025 06:45
@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

deepin-ci-robot added a commit to linuxdeepin/qt6platform-plugins that referenced this pull request Aug 18, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins.

Source-pull-request: linuxdeepin/qt5platform-plugins#300
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

根据提供的代码差异,我来分析一下代码的改进建议:

  1. DBackingStoreProxy.cpp:

    • 移除了byte_count变量,这个改动看起来是合理的,因为该变量没有被使用,移除它可以避免潜在的未使用变量警告。
  2. DDesktopInputSelectionControl.cpp:

    • getInputRectangleY函数添加了[[maybe_unused]]属性,这是一个好的实践,表明该函数可能在某些情况下不会被使用,但它的保留是有价值的。
  3. DNativeSettings.h 和 DPlatformSettings.h:

    • 移除了Q_DECL_HIDDEN宏,这可能意味着这些类不再需要隐藏其实现细节。这可能会增加API的暴露度,需要确保这是有意为之的设计决策。
  4. DXcbXSettings.cpp:

    • atomName函数添加了[[maybe_unused]]属性,与DDesktopInputSelectionControl.cpp中的改动类似。
    • 在DXcbXSettingsPrivate构造函数中重新排列了成员初始化顺序,并将成员变量初始化列表移到了参数列表之后,这是更好的C++实践。
  5. VtableHook.h:

    • 修改了偏移量检查条件,移除了< 0的检查,因为偏移量不可能是负数。这提高了代码的严谨性。
  6. 测试文件:

    • 在测试类中添加了override关键字到SetUpTearDown方法,这是很好的实践,明确表示这些方法覆盖了基类的虚函数。
  7. DHighDpi.cpp:

    • 添加了Q_UNUSED(screen)以避免未使用参数的警告,同时保留了代码逻辑。
  8. DWaylandInterfaceHook.cpp:

    • 增加了对属性值的额外检查,确保其非负且大于等于screenSplittingType,这提高了代码的健壮性。
  9. DWaylandShellManager.cpp:

    • 添加了Q_UNUSED(function)以避免未使用参数的警告,同时保留了代码逻辑。
  10. DHighDpi.cpp (xcb版本):

    • 重新排列了Q_UNUSED宏的使用顺序,将它们放在函数开始处,这是更好的代码组织方式。
  11. DPlatformBackingStoreHelper.cpp:

    • 移除了条件编译的代码块,统一使用一种方式访问m_image,这简化了代码并减少了维护负担。
  12. DPlatformIntegration.cpp:

    • overrideCreateFontCursor函数添加了[[maybe_unused]]属性。
    • overrideChangeCursor函数中添加了Q_UNUSED(w)以避免未使用参数的警告。

总体评价:
这些改动主要集中在代码质量和可维护性方面:

  1. 移除未使用的变量和参数
  2. 改进代码组织和可读性
  3. 增加必要的类型安全检查
  4. 使用现代C++特性(如[[maybe_unused]]override关键字)

这些改动都是积极的,有助于提高代码质量和可维护性。建议继续保持这种代码审查和改进的实践。

@18202781743 18202781743 merged commit 6471961 into linuxdeepin:master Aug 18, 2025
21 of 22 checks passed
18202781743 pushed a commit to linuxdeepin/qt6platform-plugins that referenced this pull request Aug 18, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins.

Source-pull-request: linuxdeepin/qt5platform-plugins#300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants